package ui.panel;
import javafx.animation.Interpolator;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.Timeline;
import javafx.application.Application;
import javafx.collections.*;
import javafx.event.*;
import javafx.geometry.Pos;
import javafx.scene.*;
import javafx.scene.control.*;
import javafx.scene.layout.*;
import javafx.scene.paint.Paint;
import javafx.scene.shape.Arc;
import javafx.scene.shape.ArcTo;
import javafx.stage.Stage;
import javafx.util.Duration;

import java.util.*;

public class FlowGo extends Application {


    @Override public void start(Stage stage) {
        Pane root  = new Pane();
        Arc arc = new Arc(400, 400, 200, 200, 0, 360);
        arc.setFill(Paint.valueOf("#63bbd0"));
        Arc arc1 = new Arc(400, 400, 0.1, 0.1, 0, 360);
        arc1.setFill(Paint.valueOf("22a2c3"));
        Button button = new Button("check me");
        button.setLayoutX(20);
        button.setLayoutY(30);
        root.getChildren().addAll(arc,arc1,button);
        Timeline timeline = new Timeline();
        Duration duration = Duration.seconds(0.66);

        button.setOnMouseClicked(event -> {
            timeline.getKeyFrames().add(new KeyFrame(duration,
                    new KeyValue(arc1.scaleXProperty(), 2000, Interpolator.EASE_IN),
                    new KeyValue(arc1.scaleYProperty(), 2000, Interpolator.EASE_IN)));
            timeline.play();

        });


        stage.setScene(new Scene(root, 800, 800));
        stage.show();
    }



    public static void main(String[] args) { launch(args); }
}